import 'dart:convert' show json;

class HomeNavigatorBeanResult {

  int? code;
  String? msg;
  List<HomeNavigatorBean?>? data;

  HomeNavigatorBeanResult.fromParams({this.code, this.msg, this.data});

  factory HomeNavigatorBeanResult(Object jsonStr) => jsonStr is String ? HomeNavigatorBeanResult.fromJson(json.decode(jsonStr)) : HomeNavigatorBeanResult.fromJson(jsonStr);

  static HomeNavigatorBeanResult? parse(jsonStr) => ['null', '', null].contains(jsonStr) ? null : HomeNavigatorBeanResult(jsonStr);

  HomeNavigatorBeanResult.fromJson(jsonRes) {
    code = jsonRes['code'];
    msg = jsonRes['msg'];
    data = jsonRes['data'] == null ? null : [];

    for (var dataItem in data == null ? [] : jsonRes['data']){
      data!.add(dataItem == null ? null : HomeNavigatorBean.fromJson(dataItem));
    }
  }

  @override
  String toString() {
    return '{"code": $code, "msg": ${msg != null?'${json.encode(msg)}':'null'}, "data": $data}';
  }

  String toJson() => this.toString();
}

class HomeNavigatorBean {

  int? id;
  double? price;
  String? giftname;
  String? giftpath;

  HomeNavigatorBean.fromParams({this.id, this.price, this.giftname, this.giftpath});

  HomeNavigatorBean.fromJson(jsonRes) {
    id = jsonRes['id'];
    price = jsonRes['price'];
    giftname = jsonRes['giftname'];
    giftpath = jsonRes['giftpath'];
  }

  @override
  String toString() {
    return '{"id": $id, "price": $price, "giftname": ${giftname != null?'${json.encode(giftname)}':'null'}, "giftpath": ${giftpath != null?'${json.encode(giftpath)}':'null'}}';
  }

  String toJson() => this.toString();
}